<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    307. Range Sum Query - Mutable
   </h1>
   <p>
    Given an integer array
    <i>
     nums
    </i>
    , find the sum of the elements between indices
    <i>
     i
    </i>
    and
    <i>
     j
    </i>
    (
    <i>
     i
    </i>
    &le;
    <i>
     j
    </i>
    ), inclusive.
   </p>
   <p>
    The
    <i>
     update(i, val)
    </i>
    function modifies
    <i>
     nums
    </i>
    by updating the element at index
    <i>
     i
    </i>
    to
    <i>
     val
    </i>
    .
   </p>
   <p>
    <b>
     Example:
    </b>
   </p>
   <pre>
Given nums = [1, 3, 5]

sumRange(0, 2) -&gt; 9
update(1, 2)
sumRange(0, 2) -&gt; 8
</pre>
   <p>
    <b>
     Note:
    </b>
   </p>
   <ol>
    <li>
     The array is only modifiable by the
     <i>
      update
     </i>
     function.
    </li>
    <li>
     You may assume the number of calls to
     <i>
      update
     </i>
     and
     <i>
      sumRange
     </i>
     function is distributed evenly.
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    307. 区域和检索 - 数组可修改
   </h1>
   <p>
    给定一个整数数组 &nbsp;
    <em>
     nums
    </em>
    ，求出数组从索引&nbsp;
    <em>
     i&nbsp;
    </em>
    到&nbsp;
    <em>
     j&nbsp;&nbsp;
    </em>
    (
    <em>
     i
    </em>
    &nbsp;&le;&nbsp;
    <em>
     j
    </em>
    ) 范围内元素的总和，包含&nbsp;
    <em>
     i,&nbsp; j&nbsp;
    </em>
    两点。
   </p>
   <p>
    <em>
     update(i, val)
    </em>
    函数可以通过将下标为&nbsp;
    <em>
     i&nbsp;
    </em>
    的数值更新为&nbsp;
    <em>
     val
    </em>
    ，从而对数列进行修改。
   </p>
   <p>
    <strong>
     示例:
    </strong>
   </p>
   <pre>Given nums = [1, 3, 5]

sumRange(0, 2) -&gt; 9
update(1, 2)
sumRange(0, 2) -&gt; 8
</pre>
   <p>
    <strong>
     说明:
    </strong>
   </p>
   <ol>
    <li>
     数组仅可以在&nbsp;
     <em>
      update&nbsp;
     </em>
     函数下进行修改。
    </li>
    <li>
     你可以假设
     <em>
      update
     </em>
     函数与
     <em>
      sumRange
     </em>
     函数的调用次数是均匀分布的。
    </li>
   </ol>
  </div>
 </body>
</html>